﻿<Window x:Class="mates_viz.UI"
    xmlns="http://schemas.microsoft.com/winfx/avalon/2005"
    xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005"
    xmlns:def="Definition" BorderThickness="0" Foreground="White"
    Text="mates" Width="1024" Height="768"
    Loaded="WindowLoaded"
    WindowStyle="None" ResizeMode="NoResize"
    >
    <!-- Add this for no border: WindowStyle="None" ResizeMode="NoResize"-->

    <Grid Name="mainvizGrid" Background="Black" MouseLeftButtonDown="gridClicked">
        <Grid.Resources>
            <Style x:Key="locationButton" TargetType="{x:Type Button}">
				<Setter Property="FontSize" Value="12"/>
				<Setter Property="FontFamily" Value="Arial"/>
				<Setter Property="Foreground" Value="White"/>
				<Setter Property="Margin" Value="2 2 2 2"/>
				<Setter Property="Template">
					<Setter.Value>
						<ControlTemplate>
							<Grid>
								<Rectangle x:Name="backgd" Margin="0 0 0 0" Grid.ColumnSpan="2" RadiusX="5" RadiusY="5" Fill="White" Opacity="0.0"/>
								<BulletPanel VerticalAlignment="Center">
									<Rectangle RadiusX="5" RadiusY="5" Height="23" Width="*Alias(Target=ActualHeight)" Fill="*Alias(Target=Background)"></Rectangle>
									<ContentPresenter Grid.Column="1" Margin="5 5 5 5" 
										VerticalAlignment="Center" HorizontalAlignment="Left" />
								</BulletPanel>
							</Grid>
						</ControlTemplate>
					</Setter.Value>
				</Setter>

				<Style.Triggers>
					<!-- Pressed -->
                    <Trigger Property="IsPressed" Value="True" >
                        <Setter TargetName="backgd" Property="Rectangle.Opacity" Value="0.50" />
                    </Trigger>
                    <EventTrigger RoutedEvent="Mouse.MouseEnter" >
                        <EventTrigger.Actions>
                            <BeginAction TargetName="MouseEnterTimeline" />
                            <StopAction TargetName="MouseLeaveTimeline" />
                        </EventTrigger.Actions>
                    </EventTrigger>
                    <EventTrigger RoutedEvent="Mouse.MouseLeave">
                        <EventTrigger.Actions>
                            <BeginAction TargetName="MouseLeaveTimeline" />
                            <StopAction TargetName="MouseEnterTimeline" />
                        </EventTrigger.Actions>
                    </EventTrigger>
                </Style.Triggers>
                <Style.Storyboards>
                    <ParallelTimeline Name="MouseEnterTimeline" BeginTime="*null" Duration="Forever">
                        <SetterTimeline  TargetName="backgd" Path="(Rectangle.Opacity)" FillBehavior="HoldEnd" >
                            <DoubleAnimation From="0" To="0.25" Duration="0:0:0.15" FillBehavior="HoldEnd" />
                        </SetterTimeline>
                    </ParallelTimeline>
                    <ParallelTimeline Name="MouseLeaveTimeline" BeginTime="*null" Duration="Forever">
                        <SetterTimeline  TargetName="backgd"  Path="(Rectangle.Opacity)" FillBehavior="HoldEnd" >
                            <DoubleAnimation From="0.25" To="0" Duration="0:0:0.45" FillBehavior="HoldEnd" />
                        </SetterTimeline>
                    </ParallelTimeline>
                </Style.Storyboards>

            </Style>
            <Style TargetType ="{x:Type TextBlock}">
				<Setter Property="Foreground" Value="White"/>
            </Style>
            <Style TargetType="{x:Type Label}">
                <Setter Property="Foreground" Value="White"/>
            </Style>
            <Style TargetType="{x:Type Button}">
				<Setter Property="Foreground" Value="White"/>
				<Setter Property="Background" Value="Black"/>
            </Style>
            <Style x:Key="interestLabel" TargetType="{x:Type Label}">
				<Setter Property="Margin" Value="2 2 2 2"/>
				<Setter Property="ClipToBounds" Value="False"/>
				<Setter Property="BorderThickness" Value="1"/>
				<Setter Property="BorderBrush" Value="#990000"/>
				<Setter Property="Background" Value="#220000"/>
				<Setter Property="Foreground" Value="#cccccc"/>
				<Style.Triggers>
                    <Trigger Property="IsMouseOver" Value="true">
                        <Setter Property="BorderBrush" Value="#FF0000"/>
                        <Setter Property="Foreground" Value="White"/>
                    </Trigger>
                </Style.Triggers>
            </Style>
            <Style x:Key="courseLabel" TargetType="{x:Type Label}">
				<Setter Property="Margin" Value="2 2 2 2"/>
				<Setter Property="ClipToBounds" Value="False"/>
				<Setter Property="BorderThickness" Value="1"/>
				<Setter Property="BorderBrush" Value="#995C00"/>
				<Setter Property="Background" Value="#331F00"/>
				<Setter Property="Foreground" Value="#cccccc"/>
				<Style.Triggers>
					<Trigger Property="IsMouseOver" Value="True">
						<Setter Property="BorderBrush" Value="#FF9300"/>
						<Setter Property="Foreground" Value="White"/>
					</Trigger>
				</Style.Triggers>
			</Style>

        </Grid.Resources>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="5"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="55"/>
            <RowDefinition Height="200"/>
        </Grid.RowDefinitions>


        <!-- Relics from Ayush's Code that need to be Replaced/Improved! -->
        <TextBlock Name="ErrorMessage" Canvas.Top="10" Canvas.Left="10" Foreground="White" FontSize="10" Opacity="1.0"  FontStretch="UltraCondensed"></TextBlock>


        <!-- Visualization is generated here from C#-->
        <Canvas Name="vizCanvas" Width="400" Height="300" Visibility="Hidden">
            <Canvas.RenderTransform>
                <ScaleTransform ScaleX="1" ScaleY="1" Center="0,0"/>
            </Canvas.RenderTransform>
        </Canvas>
        <Button Name="zoomButton" Visibility="Hidden" HorizontalAlignment="Left" VerticalAlignment="Top" Height="25" Width="35" Click="ZoomClicked">Zoom</Button>

        <!-- This canvas provides absolute positioning for the user info grid-->
        <Canvas Name="userInfoCanv" Width="400" Height="300" Visibility="Hidden">
            <Grid Name="userInfoGrid" Canvas.Left="400" Canvas.Top="300" Width="250" Height="200">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="100"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Rectangle Grid.RowSpan="2" RadiusX="5" RadiusY="5" Fill="Black" Opacity="0.75"></Rectangle>
                <Grid>
                    <Label Name="infoCanvNameLabel" FontSize="12" FontFamily="Arial" FontWeight="Bold" HorizontalAlignment="Left" Foreground="White">Username</Label>
                    <Label Name="infoCanvLocLabel" FontSize="10" HorizontalAlignment="Right" Foreground="White">User location</Label>
                </Grid>
                <Line Grid.Row="1" Stroke="White" X1="4" X2="245" Y1="-2" Y2="-2"/>
                <ScrollViewer VerticalScrollBarVisibility="Auto" Grid.Row="1">
                    <StackPanel Name="infoCanvRelationPanel">

                        <BulletPanel Margin="5,0,5,0">
                            <Rectangle Width="6" Height="6" Fill="White"/>
                            <TextBlock Foreground="White" Margin="5,0,0,0">
                                Friend of Mike
                            </TextBlock>
                        </BulletPanel>
                        <BulletPanel Margin="5,0,5,0">
                            <Rectangle Width="6" Height="6" Fill="White"/>
                            <TextBlock Foreground="White" Margin="5,0,0,0">
                                Common interest: Robotics
                            </TextBlock>
                        </BulletPanel>
                        <BulletPanel Margin="5,0,5,0">
                            <Rectangle Width="6" Height="6" Fill="White"/>
                            <TextBlock Foreground="White" Margin="5,0,0,0">
                                Common interest: Cell Phones
                            </TextBlock>
                        </BulletPanel>
                        <BulletPanel Margin="5,0,5,0">
                            <Rectangle Width="6" Height="6" Fill="White"/>
                            <TextBlock TextWrap="Wrap" Foreground="White" Margin="5,0,0,0">
                                Common course: EECS 492: Artificial Intelligence for people interested in how to teach computers to learn.
                            </TextBlock>
                        </BulletPanel>
                    </StackPanel>
                </ScrollViewer>
                <Grid VerticalAlignment="Top" Name="ProfileGrid" Grid.Row="2" Height="22">
                    <Rectangle RadiusX="5" RadiusY="5" Fill="Black" Opacity="0.75"></Rectangle>
                    <Rectangle Margin="3,3,3,0" HorizontalAlignment="Right" VerticalAlignment="Top" RadiusX="3" RadiusY="3" ClipToBounds="False" Width="55" Height="16" Stroke="White"></Rectangle>
                    <Label FontFamily="Arial" Margin="2,0,3,0" Foreground="White" HorizontalAlignment="Left" VerticalAlignment="Top">(updated 4/28 4:44pm)</Label>
                    <Label FontFamily="Arial" MouseLeftButtonDown="ProfileClicked" Margin="2,0,3,0" Foreground="White" HorizontalAlignment="Right" VerticalAlignment="Top">Profile ▼</Label>
                    <ScrollViewer Margin="5,22,5,0">
                        <Grid Height="50">
                            <TextBlock TextWrap="Wrap" Foreground="White">I was really bored so I decided to watch a movie at Quality 16.  Be back around 11.</TextBlock>
                        </Grid>
                    </ScrollViewer>
                </Grid>
            </Grid>
        </Canvas>

        <!-- Key is all done in C# code -->
        <!-- But, background opacity is 0.5 so the key is readable when shrunk onto the display -->
        <Rectangle Name="keyRectangle" Visibility="Hidden" Grid.Row="1"  Grid.Column="0" Grid.ColumnSpan="2" Fill="Black" Opacity="0.5"/>

        <Canvas Name="SetLocation" Visibility="Hidden" Grid.RowSpan="3" Grid.ColumnSpan="3" Height="480" Width="640">
            <TextBlock Canvas.Top="150" Canvas.Left="180" Foreground="White" FontSize="18" FontWeight="ExtraBold">Suggested Locations</TextBlock>
            <TextBlock Canvas.Top="175" Canvas.Left="180" Foreground="White" FontSize="12">Determined from your internet address</TextBlock>
            <StackPanel Canvas.Left="220" Canvas.Top="210">
                <ScrollViewer Background="White" VerticalScrollBarVisibility ="Hidden">
                    <StackPanel Name="LocGuessPanel" Opacity="1" VerticalAlignment="Center" HorizontalAlignment="Left"/>
                </ScrollViewer>
                <Button Style="{StaticResource stdButton}" Click="NewLoc" Margin="0 20 0 0">None of these</Button>
            </StackPanel>
        </Canvas>
        <Canvas Name="GPSLocation" Visibility="Hidden" Grid.RowSpan="3" Grid.ColumnSpan="3" Height="480" Width="640">
            <TextBlock Canvas.Top="220" Canvas.Left="80" FontSize="12" Foreground="white" FontWeight="Bold" >Please enter your GPS Coordinates</TextBlock>
            <TextBlock Canvas.Top="250" Canvas.Left="80" FontSize="12" Foreground="white" >Latitude:</TextBlock>
            <TextBlock Canvas.Top="280" Canvas.Left="80" FontSize="12" Foreground="white" >Longitude:</TextBlock>
            <TextBox Canvas.Top="247" Canvas.Left="160" Name="newLocX" Width="60" Background="White" AcceptsReturn="False" Opacity="0.9"></TextBox>
            <TextBox Canvas.Top="277" Canvas.Left="160" Name="newLocY" Width="60" Background="White" AcceptsReturn="False" Opacity="0.9"></TextBox>
            <Button Click="SearchNearby"  Canvas.Top="320" Canvas.Left="160" Style="{StaticResource stdButton}">Search Nearby</Button>
            <TextBlock FontSize="12" Foreground="white" FontWeight="Bold" Canvas.Top="120" Canvas.Left="420" >Where are you located?</TextBlock>
            <ScrollViewer VerticalScrollBarVisibility="Auto" Height="180" Canvas.Top="140" Canvas.Left="430">
                <StackPanel Name="GPSLocPanel"  Opacity="1" VerticalAlignment="Top"  HorizontalAlignment="Left">
                    <!-- GPS Locs go here -->
                </StackPanel>
            </ScrollViewer>
            <TextBlock Canvas.Top="340" Canvas.Left="400" FontSize="12" FontWeight="Bold" Foreground="white" >I am at:</TextBlock>
            <TextBox Name="newLocName" Canvas.Top="337" Canvas.Left="480" Width="100" Background="White" AcceptsReturn="False" Opacity="0.9"/>
            <Button Visibility="Visible" BorderBrush="Orange" Foreground="White" Background="Black" Width="80" Click="SetLoc" Canvas.Bottom="50" Canvas.Left="420">Done</Button>
        </Canvas>
        <Canvas Name="LoginCanv" Opacity="1.0" Visibility="Hidden" Grid.RowSpan="3" Grid.ColumnSpan="3" Height="480" Width="640">
            <TextBlock Canvas.Top="150" Canvas.Left="180" Foreground="White" FontSize="18" FontWeight="ExtraBold">Welcome to mates!</TextBlock>
            <TextBlock Canvas.Top="175" Canvas.Left="200" Foreground="White" FontSize="12" >Please enter your information</TextBlock>
            <TextBlock Canvas.Top="213" Canvas.Right="400" FontSize="12" Foreground="white" >Username</TextBlock>
            <TextBlock Canvas.Top="243" Canvas.Right="400" FontSize="12" Foreground="white" >Password</TextBlock>
            <TextBox Name="txtUsername" Canvas.Top="210" Canvas.Left="280" Width="100" Background="White" AcceptsReturn="False" Opacity="0.9"/>
            <TextBox Name="txtPassword" Canvas.Top="240" Canvas.Left="280"  Width="100" Background="White" AcceptsReturn="False" Opacity="0.9"/>
            <Button Click="Login" Style="{StaticResource stdButton}" Canvas.Top="280" Canvas.Left="280" Width="80">Login</Button>
            
			
			<Label MouseLeftButtonDown="UI_register" Canvas.Top="320" Canvas.Left="280" Foreground="White">Create a new account</Label>
        </Canvas>
        <Canvas Name="RegCanv" Opacity="1.0" Visibility="Hidden" Grid.RowSpan="3" Grid.ColumnSpan="3" Height="480" Width="640">
            <TextBlock Canvas.Top="150" Canvas.Left="180" Foreground="White" FontSize="18" FontWeight="ExtraBold">Create a new account</TextBlock>
            <TextBlock Canvas.Top="175" Canvas.Left="200" Foreground="White" FontSize="12" >Please enter your information</TextBlock>
            <TextBlock TextAlignment="Right" Canvas.Top="213" Canvas.Right="400" FontSize="12" Foreground="white">Username</TextBlock>
            <TextBlock TextAlignment="Right" Canvas.Top="243" Canvas.Right="400" FontSize="12" Foreground="white">Password</TextBlock>
            <TextBlock TextAlignment="Right" Canvas.Top="273" Canvas.Right="400" FontSize="12" Foreground="white">Confirm password</TextBlock>
            <TextBox Name="Reg_txtUsername" Canvas.Top="210" Canvas.Left="280" Width="100" Background="White" AcceptsReturn="False" Opacity="0.9"/>
            <TextBox Name="Reg_Pswd" Canvas.Top="240" Canvas.Left="280" Width="100" Background="White" AcceptsReturn="False" Opacity="0.9"/>
            <TextBox Name="Reg_ConfirmPswd" Canvas.Top="270" Canvas.Left="280"  Width="100" Background="White" AcceptsReturn="False" Opacity="0.9">
                <TextBox.Opacity>0.9</TextBox.Opacity>
            </TextBox>
            <Button Click="Register" Canvas.Top="310" Canvas.Left="280" BorderBrush="Orange" Foreground="White" Background="Black" Width="80">Register</Button>
            <Label MouseLeftButtonDown="UI_login" Canvas.Top="350" Canvas.Left="280" Foreground="White">Return to login screen</Label>
        </Canvas>

        <!--
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Bottom">
            <StackPanel Name="ClassStackPanel" Width="100" Visibility="Hidden">
                <ScrollViewer Height="270" VerticalScrollBarVisibility="Auto"  Canvas.Top="15" Canvas.Right="15">
                    <StackPanel Style="{stretchPanel}" Name="ClassPanel" Visibility="Collapsed" VerticalAlignment="Bottom" HorizontalAlignment="Center" >
                        <Button Click="AddCourse" Style="{glowButton}" Width="20" Height="20" Foreground="Red" FontFamily="ArialBlack" FontWeight="Black" FontSize="15">+</Button>
                    </StackPanel>
                </ScrollViewer>
                <Button Name="classes" Click="ClassesClicked" Style="{stdButton}">my classes</Button>
            </StackPanel>
        </StackPanel>
-->

        <!-- Friends -->
        <!-- Background Opacity 0.5 so friends is readable when shrunk onto the display -->
        <Rectangle Name="friendsRectangle" Visibility="Hidden" Grid.Column="2" Grid.RowSpan="3" Fill="Black" Opacity="0.5"/>

        <Grid Name="friendGrid" Visibility="Hidden" Grid.Column="2" Grid.RowSpan="3" Width="160">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>

            <StackPanel Name="friendPanel" VerticalAlignment="Top" HorizontalAlignment="Left" Grid.Column="0" Grid.Row="1" Width="160">

                <TextBlock FontSize="12" FontFamily="Arial" TextWrap="Wrap" Foreground="#cccccc" Margin="3 5 3 5">
                    <Italic>You don't have any friends!  Why not add some now?</Italic>
                </TextBlock>
                <!-- Friends added here in C# code -->

                <StackPanel Grid.Row="1" Margin="3 15 3 5">
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                        <TextBlock FontSize="12" FontFamily="Arial" Foreground="White" VerticalAlignment="Center">
                            New friend:
                        </TextBlock>
                        <TextBox Name="friendNameTxtBox" MaxLength="12"  Width="80" VerticalAlignment="Center" BorderBrush="#000099" Foreground="White" BorderThickness="1" Background="Black" Margin="3 0 0 0"/>
                    </StackPanel>
                    <Button Foreground="White" Width="35" Background="Black" BorderBrush="#000099" HorizontalAlignment="Right" Click="AddFriendClicked" Margin="0 5 0 0">Add</Button>
                </StackPanel>

            </StackPanel>

            <!-- Friends Title Block (will rotate when clicked) -->
            <Canvas HorizontalAlignment="Left" Name="friendsTitleCanv" Height="25" Width="70" Margin="0 0 0 10">
                <Rectangle Canvas.Top="-1.5" Canvas.Left="-3.5"  RadiusX="4" RadiusY="4" Fill="#000033" Width="91" Height="26" Stroke="#000099" StrokeThickness="1" MouseLeftButtonDown="friendTitleMouseDown"/>
                <Label FontSize="14" FontWeight="Bold" FontFamily="Arial" MouseLeftButtonDown="friendTitleMouseDown">
                    Friends ▼
                </Label>
                <Canvas.RenderTransform>
                    <RotateTransform Angle="0" Center="44,43"></RotateTransform>
                </Canvas.RenderTransform>
            </Canvas>

        </Grid>


        <Rectangle Name="border1" Visibility="Hidden" Grid.Column="1" Grid.RowSpan="3" Width="1" Fill="Blue"/>

        <!-- Panel -->
        <Border Name="Panel" Visibility="Hidden" Grid.Column="0" Grid.Row="2" BorderThickness="10" BorderBrush="Black">
            <TabControl TabStripPlacement="Bottom" Background="#000033" BorderBrush="#000099" BorderThickness="2" SelectionChanged="tabChange">
                <TabItem Name="TabItem_Location" Header="Location" FontSize="14" FontWeight="Bold" FontFamily="Arial" Background="#000055" BorderBrush="#000099" Foreground="White">
                    <Grid Name="locationPanelGrid">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="180"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>

                        <Rectangle Grid.Column="0" Grid.RowSpan="2" RadiusX="15" RadiusY="15" Fill="Black" Margin="2 2 20 2"/>
                        <Rectangle Name="locationPanel_locRectangle" Grid.Column="0" Grid.RowSpan="2" RadiusX="15" RadiusY="15" Fill="Gray" Margin="3 3 21 3"/>
                        <StackPanel Grid.Column="0" Grid.RowSpan="2" Grid.Row="0" Margin="18 3 36 3">
                            <TextBlock Name="locationPanel_locName" Margin="0 10 0 0" FontSize="14" TextWrap="Wrap" FontFamily="Arial" Foreground="White">
                                No Location Selected
                            </TextBlock>
                            <TextBlock Name="locationPanel_locUsers_locDist_locDir" FontSize="12" FontFamily="Arial" Foreground="White">
                                4 Users, 26' NE
                            </TextBlock>
                            <TextBlock FontSize="12" FontFamily="Arial" Foreground="White" Margin="0 15 0 0">
                                Last updated:
                            </TextBlock>
                            <TextBlock Name="locationPanel_lastUpdated" FontSize="12" FontFamily="Arial" Foreground="White" Margin="0 5 0 0">
                                April 24th @ 3:56pm
                            </TextBlock>
                            <TextBlock Name="locationPanel_updatedBy" FontSize="12" FontFamily="Arial" Foreground="White">
                                by Adam
                            </TextBlock>
                        </StackPanel>

                        <Grid Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="0" Margin="0 2 0 0">
                            <Rectangle RadiusX="15" RadiusY="15" Fill="#000022"/>
                            <ScrollViewer VerticalScrollBarVisibility="Auto" Margin="0 0 15 0">
                                <TextBox Name="locationPanel_wall" IsEnabled="False" Wrap="True" Margin="15 0 0 0" Foreground="#cccccc" FontFamily="Arial" FontSize="12" Background="Transparent" BorderThickness="0">
                                    The Duderstadt Center will be giving away free ice cream at 2pm in celebration of summer!
                                </TextBox>
                            </ScrollViewer>
                        </Grid>

                        <TextBlock Grid.Column="1" Grid.ColumnSpan="2"  Grid.Row="1" FontSize="12" FontFamily="Arial" Foreground="White" VerticalAlignment="Center" Margin="15 0 0 0">
                            Note: The location wall can be seen by all nearby users.
                        </TextBlock>
                        <Button Name="button_changeWallCancel" Grid.Column="1" Grid.Row="1" Click="changeWallCancel" HorizontalAlignment="Right" Foreground="White" Width="100" Background="Black" BorderBrush="#000099" Margin="3 5 0 0" Visibility="Hidden">Cancel</Button>
                        <Button Name="button_changeWall" Grid.Column="2" Grid.Row="1" Click="changeWall" HorizontalAlignment="Right" Foreground="White" Width="100" Background="Black" BorderBrush="#000099" Margin="3 5 0 0">Change Wall</Button>
                    </Grid>
                </TabItem>
                <TabItem Name="TabItem_Messages" Header="Messages" FontSize="14" FontWeight="Bold" FontFamily="Arial" Background="#004400" BorderBrush="#009900" Foreground="White">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="90"/>
                            <ColumnDefinition Width="90"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="121"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>

                        <Border Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4" BorderBrush="#009900" BorderThickness="1" Background="#002200" Margin="3 0 0 5">
                            <ScrollViewer Name="MessageWindowScroller" VerticalScrollBarVisibility="Auto">
                                <StackPanel Name="MessageWindow">
                                    <!-- Messages go here in C# -->
                                </StackPanel>
                            </ScrollViewer>
                        </Border>

                        <TextBlock Grid.Column="0" Grid.Row="1" FontSize="12" FontFamily="Arial" Foreground="White" VerticalAlignment="Center">
                            Send Message:
                        </TextBlock>
                        <TextBox Name="Send_Message_To"  Grid.Column="1" Grid.Row="1" MaxLength="12"  Width="80" VerticalAlignment="Center" BorderBrush="#009900" Foreground="White" BorderThickness="1" Background="Black" FontFamily="Arial" FontSize="12">Username</TextBox>
                        <TextBox Name="Send_Message_Text"  Grid.Column="2" Grid.Row="1" MaxLength="255" VerticalAlignment="Center" BorderBrush="#009900" Foreground="White" BorderThickness="1" Background="Black" FontFamily="Arial" FontSize="12">Click here to type a message.</TextBox>
                        <Button Grid.Column="3" Grid.Row="1" Foreground="White" Width="100" Background="Black" BorderBrush="#009900" VerticalAlignment="Center" Margin="3 0 0 0" FontFamily="Arial" FontSize="12">Send</Button>
                    </Grid>
                </TabItem>
                <TabItem Name="TabItem_Interests" Header="Interests" FontSize="14" FontWeight="Bold" FontFamily="Arial" Background="#440000" BorderBrush="#990000" Foreground="White">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="121"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>

                        <Border Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" BorderBrush="#990000" BorderThickness="1" Margin="3 0 0 5">
                            <ScrollViewer VerticalScrollBarVisibility="Auto">
                                <!-- ScrollViewer doesn't seem to be working properly here -->
                                <TextFlow Name="TextFlow_Interests">
                                    <!-- Interests go here -->
                                </TextFlow>
                            </ScrollViewer>
                        </Border>

                        <TextBlock Grid.Column="0" Grid.Row="1" FontSize="12" FontFamily="Arial" Foreground="White" VerticalAlignment="Center">
                            Add interests to discover more relationships!
                        </TextBlock>
                        <StackPanel Grid.Column="1" Grid.Row="1" Orientation="Horizontal">
                            <TextBlock FontSize="12" FontFamily="Arial" Foreground="White" VerticalAlignment="Center" Margin="3 0 0 0">
                                New Interest:
                            </TextBlock>
                            <TextBox Name="newInterest" MaxLength="255"  Width="240" VerticalAlignment="Center" BorderBrush="#990000" Foreground="White" BorderThickness="1" Background="Black" Margin="3 0 0 0">Interest</TextBox>
                            <Button Click="button_addInterest"  Foreground="White" Width="100" Background="Black" BorderBrush="#990000" VerticalAlignment="Center" Margin="3 0 0 0">Add</Button>
                        </StackPanel>
                    </Grid>
                </TabItem>
                <TabItem Name="TabItem_Courses" Header="Courses" FontSize="14" FontWeight="Bold" FontFamily="Arial" Background="#422800" BorderBrush="#995C00" Foreground="White">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="121"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>

                        <Border Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" BorderBrush="#995C00" BorderThickness="1" Margin="3 0 0 5">
                            <ScrollViewer VerticalScrollBarVisibility="Auto">
                                <!-- ScrollViewer doesn't seem to be working properly here -->
                                <TextFlow Name="TextFlow_Courses">
                                    <!-- Interests go here -->
                                </TextFlow>
                            </ScrollViewer>
                        </Border>

                        <TextBlock Grid.Column="0" Grid.Row="1" FontSize="12" FontFamily="Arial" Foreground="White" VerticalAlignment="Center">
                            Add courses to discover your classmates!
                        </TextBlock>
                        <StackPanel Grid.Column="1" Grid.Row="1" Orientation="Horizontal">
                            <TextBlock FontSize="12" FontFamily="Arial" Foreground="White" VerticalAlignment="Center" Margin="3 0 0 0">
                                New Course:
                            </TextBlock>
                            <TextBox Name="newCourse" MaxLength="255"  Width="240" VerticalAlignment="Center" BorderBrush="#995C00" Foreground="White" BorderThickness="1" Background="Black" Margin="3 0 0 0">Course</TextBox>
                            <Button Click="button_addCourse" Foreground="White" Width="100" Background="Black" BorderBrush="#995C00" VerticalAlignment="Center" Margin="3 0 0 0">Add</Button>
                        </StackPanel>
                    </Grid>
                </TabItem>
            </TabControl>
        </Border>

        <Rectangle Name="border2" Visibility="Hidden" Grid.ColumnSpan="3" Grid.RowSpan="3" Stroke="#000099" StrokeThickness="2"/>


        <!-- This rectangle, when made visible, greys out all controls on the main form except that which is below it here -->
        <Rectangle Name="DisableStuff" Visibility="Hidden" Opacity="0.50" Fill="Black"/>

        <Grid Canvas.Left="200" Canvas.Top="100" Name="InputPanel" Width="200" Height="90" ClipToBounds="False" Visibility="Hidden">
            <Grid.RowDefinitions>
                <RowDefinition Height="30"/>
                <RowDefinition Height="30"/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>

            <!-- RowSpan is used to cause the items to not be restricted to their original grid squares-->
            <Rectangle Grid.RowSpan="3" Grid.ColumnSpan="2" RadiusX="20" RadiusY="20" Fill="Blue" Opacity="0.60" Width="200" Height="90"/>
            <Label Name="InputPanelText" Grid.ColumnSpan="2" HorizontalContentAlignment ="Center" Foreground="White">Enter your friend's user name:</Label>
            <TextBox Grid.Row="1" Grid.ColumnSpan="2" Name="inputUserText" Foreground="White" Background="Black"></TextBox>
            <Button Grid.Row="2" Grid.Column="0" Width="60" Height="20" Click="inputPanelOKClicked">Ok</Button>
            <Button Grid.Row="2" Grid.Column="1" Width="60" Height="20" Click="inputPanelCancelClicked">Cancel</Button>
        </Grid>



    </Grid>

    <Window.Storyboards>

        <ParallelTimeline BeginTime="*null" x:Name="collapseFriends" Duration="Forever">
            <SetterTimeline FillBehavior="HoldEnd" TargetName="friendsTitleCanv" Path="(Canvas.RenderTransform).(RotateTransform.Angle)">
                <DoubleAnimation To="-90" From="0" AccelerationRatio="0.5" DecelerationRatio="0.5" Duration="0:0:0.75" FillBehavior="HoldEnd"/>
            </SetterTimeline>
            <SetterTimeline FillBehavior="HoldEnd" TargetName="friendGrid" Path="(Grid.Width)">
                <DoubleAnimation From="160" To="25" Duration="0:0:0.75" FillBehavior="HoldEnd"/>
            </SetterTimeline>
            <SetterTimeline FillBehavior="HoldEnd" TargetName="friendPanel" Path="(StackPanel.Opacity)">
                <DoubleAnimation To="0" Duration="0:0:0.35" FillBehavior="HoldEnd"/>
            </SetterTimeline>
        </ParallelTimeline>
        <ParallelTimeline BeginTime="*null" x:Name="expandFriends" Duration="Forever">
            <SetterTimeline FillBehavior="HoldEnd" AccelerationRatio="0.5" DecelerationRatio="0.5" TargetName="friendsTitleCanv" Path="(Canvas.RenderTransform).(RotateTransform.Angle)">
                <DoubleAnimation To="0" From="-90" Duration="0:0:0.75" FillBehavior="HoldEnd"/>
            </SetterTimeline>
            <SetterTimeline FillBehavior="HoldEnd" TargetName="friendGrid" Path="(Grid.Width)">
                <DoubleAnimation From="25" To="160" Duration="0:0:0.75" FillBehavior="HoldEnd"/>
            </SetterTimeline>
            <SetterTimeline FillBehavior="HoldEnd" TargetName="friendPanel" Value="0.0" Path="(StackPanel.Opacity)">
                <DoubleAnimation From="0" To="1" BeginTime="0:0:0.35" Duration="0:0:0.75" FillBehavior="HoldEnd"/>
            </SetterTimeline>
        </ParallelTimeline>

        <ParallelTimeline x:Name="ShowInputPanel" BeginTime="*null" Duration="Forever">
            <SetterTimeline TargetName="InputPanel" Path="(Grid.Opacity)" FillBehavior="HoldEnd" >
                <DoubleAnimation From="0" To="1" Duration="0:0:0.50" FillBehavior="HoldEnd" />
            </SetterTimeline>
            <SetterTimeline  TargetName="InputPanel" Path="(Canvas.Left)" FillBehavior="HoldEnd" >
                <DoubleAnimation From="100" To="150" Duration="0:0:0.70" FillBehavior="HoldEnd" />
            </SetterTimeline>
        </ParallelTimeline>

        <ParallelTimeline x:Name="HideInputPanel" BeginTime="*null" Duration="Forever" >
            <SetterTimeline TargetName="InputPanel" Path="(Grid.Opacity)" FillBehavior="HoldEnd" >
                <DoubleAnimation From="1" To="0" Duration="0:0:0.50" FillBehavior="HoldEnd" />
            </SetterTimeline>
            <SetterTimeline  TargetName="InputPanel" Path="(Canvas.Left)" FillBehavior="HoldEnd" >
                <DoubleAnimation From="150" To="200" Duration="0:0:0.70" FillBehavior="HoldEnd" />
            </SetterTimeline>
        </ParallelTimeline>

		<!-- Ended="zoomEnded" used to be called here -->
        <ParallelTimeline AccelerationRatio="0.2" DecelerationRatio="0.2" x:Name="ZoomIn" BeginTime="*null" >

            <!-- Zoom in X -->
            <SetterTimeline TargetName="vizCanvas" Path="(Grid.RenderTransform).(ScaleTransform.ScaleX)">
                <DoubleAnimation From="1" To="3" Duration="0:0:5" AutoReverse="True" FillBehavior ="HoldEnd" />
            </SetterTimeline>

            <!-- Zoom in Y -->
            <SetterTimeline TargetName="vizCanvas" Path="(Grid.RenderTransform).(ScaleTransform.ScaleY)">
                <DoubleAnimation From="1" To="3" Duration="0:0:5" AutoReverse="True" FillBehavior ="HoldEnd" />
            </SetterTimeline>

        </ParallelTimeline>

        <ParallelTimeline x:Name="FadeInVisualization" BeginTime="*null" Duration="Forever" FillBehavior="HoldEnd" >
            <!-- Animates the opacity of the rectangle from 1.0 to 0.0 over five seconds. -->
            <SetterTimeline TargetName="vizCanvas" Path="(Grid.Opacity)" FillBehavior="HoldEnd" >
                <DoubleAnimation From="0.0" To="1.0" Duration="0:0:5" FillBehavior ="HoldEnd" />
            </SetterTimeline>
        </ParallelTimeline>

        <ParallelTimeline x:Name="CollapseGrid" BeginTime="*null" Duration="Forever">
            <SetterTimeline TargetName="ProfileGrid" Path="(Grid.Height)" FillBehavior="HoldEnd" >
                <DoubleAnimation AccelerationRatio="0.5" From="60" To="22" Duration="0:0:0.5" FillBehavior="HoldEnd" />
            </SetterTimeline>
        </ParallelTimeline>

        <ParallelTimeline x:Name="ExpandGrid" BeginTime="*null" Duration="Forever">
            <SetterTimeline TargetName="ProfileGrid" Path="(Grid.Height)" FillBehavior="HoldEnd" >
                <DoubleAnimation AccelerationRatio="0.5" From="22" To="60" Duration="0:0:0.5" FillBehavior="HoldEnd" />
            </SetterTimeline>
        </ParallelTimeline>


    </Window.Storyboards>



</Window>